How to remove blank page after title page in LaTex?

您所在的位置:网站首页 how to delete extra empty or blank pages in a How to remove blank page after title page in LaTex?

How to remove blank page after title page in LaTex?

2023-04-21 22:38| 来源: 网络整理| 查看: 265

\frontmatter is the cause behind this as it inserts a \cleardoublepage. While \newpage and \clearpage are gobbled if used successively, \cleardoublepage does more than just clear a page or possibly more. In order to succeed in possibly clearing a blank page as well, it inserts an \hbox{} on a page (which prints nothing) and then issues another \newpage, otherwise it may be gobbled. Here's the actual definition (from latex.ltx):

\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}

So, here's your sequence of instructions:

\begin{titlepage} % \end{titlepage} \newpage \frontmatter

The titlepage is constructed on page 1. Then you insert a \newpage, putting you on page 2. Issuing \frontmatter on page 2, leaves \cleardoublepage to call:

\clearpage % ...this is gobbled, since the it follows from a \newpage \if@twoside % ...this is true within book \ifodd\c@page % ...this is false, so \else % ...follow this branch \hbox{}% ...insert something that doesn't print anything \newpage% ...issue a (legal) \newpage \if@twocolumn%...this is false... \hbox{}% \newpage% \fi \fi \fi}

You can remove the blank page using atbegshi's \AtBeginShipoutNext{\AtBeginShipoutDiscard}:

\usepackage{atbegshi} \begin{titlepage} % \end{titlepage} \newpage \AtBeginShipoutNext{\AtBeginShipoutDiscard}% Discard next blank page \frontmatter

or just do whatever \frontmatter does manually. Here's \frontmatter's definition from book.cls:

\newcommand\frontmatter{% \cleardoublepage \@mainmatterfalse \pagenumbering{roman}}

Since you're changing the page numbering anyway, just use

\begin{titlepage} % \end{titlepage} \newpage \csname @mainmatterfalse\endcsname

(which avoids using a \makeatletter...\makeatother pair).



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3